package cc.lishixi.tdd.inject;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.RepetitionInfo;

/**
 * @author LiShixi 2021/1/1 3:56 下午
 * @email loyy77@163.com
 */

public class RepetitionInfoDemo {
    /**
     * {displayName} 测试方法名称
     * currentRepetition 重复执行的当前第几次
     * totalRepetitions 总次数
     * @param repeatedTest
     */
    @RepeatedTest(value = 7,name = "{displayName}重复执行，第 {currentRepetition}次，共{totalRepetitions}次")
    public void t(RepetitionInfo repeatedTest) {
        System.out.println(repeatedTest.getCurrentRepetition());
        Assertions.assertEquals(7, repeatedTest.getTotalRepetitions());
    }
}
